import request from '@/utils/request';
import { getCookie } from '@/utils/authority';

export async function queryRule(params) {
  return request('/api/deviceInfo', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}
export async function removeRule(params) {
  return request('/api/delDeviceInfo', {
    method: 'POST',
    headers: {
      'login-token': getCookie('tks'),
    },
    data: { ...params },
  });
}

export async function getDeviceNum() {
  return request('/api/deviceNumber', {
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function getVMAlarmInfos(params) {
  return request('/api/getVMAlarmInfos', {
    params,
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}

export async function updateThreshold(params) {
  return request('/api/updateThreshold', {
    method: 'POST',
    headers: {
      'login-token': getCookie('tks'),
    },
    data: { ...params },
  });
}
export async function syncVMIds() {
  return request('/api/syncVMIds', {
    headers: {
      'login-token': getCookie('tks'),
    },
  });
}
